<template>
  <div class="page achdetail">
    <div class="bread">
      <el-breadcrumb separator="/" class="datails_nav">
        <el-breadcrumb-item :to="{ path: '/' }">
          <el-icon><HomeFilled /></el-icon>首页</el-breadcrumb-item
        >
        <el-breadcrumb-item :to="{ path: '/acl/user' }"
          >科技成果</el-breadcrumb-item
        >
        <el-breadcrumb-item>成果详情</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="mainbox">
      <!-- 介绍 -->
      <div class="mainbox_top">
        <!-- <img :src="achdetail.achImage.path" alt=""> -->
        <el-image class="elimg" :src="achdetail.achImage?.path" fit="cover">
          <template #error>
            <div class="image-slot">
              <img
                class="elimg"
                src="/src/assets/resultimg.png"
                fit="cover"
                alt=""
              />
            </div>
          </template>
        </el-image>
        <div class="mainbox_top_right">
          <div class="mainbox_top_right_top">
            <div>
              <p class="title">{{ achdetail.achName }}</p>
              <p class="belong">
                <img
                  data-v-4b228890=""
                  src=""
                  alt=""
                />&nbsp;所属单位或公司名称：{{ achdetail.company }}
              </p>
            </div>
            <!-- <div class="twobtn">
                            <p class="collect pointer">
                                收藏
                            </p>
                            <p class="liuyan u-m-l-10 pointer">
                                我要留言
                            </p>
                        </div> -->
          </div>
          <div class="mainbox_top_right_content">
            <el-row>
              <el-col :span="10">
                <p class="samewidth hidden-1">
                  技术领域：
                  <span v-for="i in achdetail.field">{{ i }},</span>
                </p>
              </el-col>
              <el-col :span="7">
                <p class="samewidth">成果形式：{{ achdetail.maturity }}</p>
              </el-col>
              <el-col :span="7">
                <p class="samewidth">成果权属：{{ achdetail.achAscription }}</p>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="10">
                <p class="samewidth">所需资金：{{ achdetail.money }}</p>
              </el-col>
              <el-col :span="7">
                <p class="samewidth">所属地区：{{ achdetail.province }}</p>
              </el-col>
              <el-col :span="7">
                <p class="samewidth">
                  有效期：
                  <span v-for="i in achdetail.rdTime">{{ i }}</span>
                </p>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="10">
                <p class="samewidth">
                  合作方式：
                  <span v-for="i in achdetail.conMethod">{{ i }},</span>
                </p>
              </el-col>
              <el-col :span="7">
                <p class="samewidth">单位性质：{{ achdetail.companyType }}</p>
              </el-col>
              <el-col :span="7">
                <p class="samewidth">项目阶段：批量生产</p>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="10">
                <p class="samewidth">更新时间：{{ achdetail.updateTime }}</p>
              </el-col>
              <el-col :span="7">
                <p class="samewidth">信息来源：站内</p>
              </el-col>
              <el-col :span="7"> </el-col>
            </el-row>
          </div>
        </div>
      </div>
      <!-- 成果详情 -->
      <div class="reasultdetail">
        <el-tabs
          v-model="activeName"
          class="demo-tabs"
          @tab-click="handleClick"
        >
          <el-tab-pane label="成果详情" name="first">
            <p class="" v-html="achdetail.achDetail"></p
          ></el-tab-pane>
        </el-tabs>
      </div>
      <!-- 相关需求 -->
      <div class="aboutrequire">
        <div class="title">相关需求</div>
        <el-divider />

        <div class="aboutrequirebox">
          <div
            class="aboutrequirebox_item xuqiu pointer"
            v-show="i.state == '已审核'"
            @click="todemdetail(i.id)"
            v-for="i in demlist"
          >
            <!-- <img :src="i.demImage.path" alt=""> -->
            <el-image class="elimg" :src="i.demImage.path" fit="cover">
              <template #error>
                <div class="image-slot">
                  <img
                    class="elimg"
                    src="/src/assets/requireimg.png"
                    fit="cover"
                    alt=""
                  />
                </div>
              </template>
            </el-image>
            <div class="xq-box">
              <p class="title hidden-1">{{ i.demName }}</p>
              <p class="grey hidden-1">
                预算资金：<span style="color: #f15916">{{ i.createTime }}</span>
              </p>
              <p class="grey">
                技术领域：<span>{{ i.createTime }}</span>
              </p>
            </div>
          </div>
        </div>
        <el-empty v-if="demlist == ''" description="暂无数据~" />
      </div>
      <!-- 相关专家 -->
      <div class="aboutrequire">
        <div class="title">相关专家</div>
        <el-divider />
        <ul class="clc-ui aboutrequirebox">
          <li
            @click="changeitem(item.id)"
            v-show="item.state != '待审核'"
            v-for="(item, index) in teacherlist"
          >
            <div>
              <div class="clc-lia">
                <div class="clcig">
                  <img src="../../assets/touxiang-m.png" alt="" />
                </div>
                <div class="clc-lia-name">
                  <div>
                    <b> {{ item.name }} </b>
                  </div>
                  <div class="clncol">
                    {{ item.post }}
                  </div>
                  <div class="gang"></div>
                </div>
              </div>
              <div style="text-align: center">
                <div class="Adminis">
                  {{ item.enterprise }}
                </div>
              </div>
            </div>
          </li>
        </ul>
        <el-empty v-if="teacherlist == ''" description="暂无数据~" />
      </div>
      <!-- 相关机构 -->
      <div class="aboutrequire">
        <div class="title">相关机构</div>
        <el-divider />

        <!-- <div class="aboutrequirebox">
          <div class="aboutrequirebox_item" v-for="i in orglist">
            <img src="../../assets/首页/daogu.png" alt="" />
            <p class="title u-m-tb-10">阿斯顿</p>
            <p class="grey">技术领域：电子信息技术</p>
            <p class="grey u-m-tb-10">单位性质：大专郑州</p>
          </div>
        </div> -->
        <div class="card_box">
          <div
            class="card"
            @click="changeitem(index)"
            v-for="(item, index) in orglist"
          >
            <img src="http://www.nttzzc.com/Manage/Images/yanfa.png" alt="" />
            <div class="card_text">
              <p class="card_name">河南省矿源矿山起重机研究院有限公司</p>
              <p class="card_add">河南省新乡市长垣市魏庄镇矿山路中段</p>
              <div class="card_pop_wrap">
                <span class="card_pop">先进制造与装备</span
                ><!---->
              </div>
            </div>
          </div>
        </div>
        <el-empty v-if="orglist == ''" description="暂无数据~" />
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { ref, onMounted, getCurrentInstance } from "vue";
import { useRoute } from "vue-router";
import { ArrowRight, HomeFilled } from "@element-plus/icons-vue";
import { getachdetail } from "@/api/user/index";
const route = useRoute();
onMounted(() => {});
const activeName = ref("first");
const achdetail: any = ref({});
const { proxy } = getCurrentInstance() as any;

const todemdetail = (id: any) => {
  proxy.$router.push({
    path: "/product/requiredetail",
    query: {
      id: id,
    },
  });
};

const toteacherdetail = (id: any) => {
  proxy.$router.push({
    path: "/product/peopledetail",
    query: {
      id: id,
    },
  });
};
//相关机构
const orglist: any = ref([]);
function getorglist() {
  proxy
    .$get("/user/list/org", {
      current: 1,
      limit: 4,
      field: "",
    })
    .then((res: any) => {
      orglist.value = res.data.records;
    });
}

getorglist();
//相关需求
const demlist: any = ref([]);
function getdemlist() {
  proxy
    .$get("/dem/list", {
      current: 1,
      limit: 4,
      demType: "",
      lifespan: "",
      field: "",
      cooperateMode: "",
    })
    .then((res: any) => {
      res.data.records.map((item) => {
        return (item.demImage = JSON.parse(item.demImage));
      });
      demlist.value = res.data.records;
    });
}

getdemlist();

//相关专家
const teacherlist: any = ref([]);
function getteacherlist() {
  proxy
    .$get("/user/list/teacher", {
      current: 1,
      limit: 3,
      field: "",
    })
    .then((res: any) => {
      teacherlist.value = res.data.records;
    });
}

getteacherlist();

const getachdetaildata = async () => {
  const res = await getachdetail(route.query.id);
  achdetail.value = res.data;
};

getachdetaildata();


const handleClick = async(id: any) =>{

}


const changeitem = async(id: any) =>{

}

</script>
<style lang="scss" scoped>
@mixin flex {
  display: flex;
  align-items: center;
}

.page {
  width: 100%;

  .bread {
    width: 1400px;
    box-sizing: border-box;
    margin: 0px auto;
  }
}
.datails_nav {
  line-height: normal;
  :deep(.el-breadcrumb__inner) {
    display: flex;
    align-items: center;
  }
}
.achdetail .mainbox {
  width: 1460px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.06);
  opacity: 1;
  border-radius: 0;
  margin: 0 auto;
  padding: 35px 30px;
  background: #fff;
  border-radius: 10px;
  margin-bottom: 60px;
  .title {
    font-size: 20px;
    font-weight: bold;
  }

  .mainbox_top {
    @include flex();
    align-items: flex-start;
    .elimg {
      width: 420px;
      height: 226px;
      overflow: hidden;
      img {
        width: 100%;
        vertical-align: bottom;
      }
    }

    .mainbox_top_right {
      margin-left: 40px;
      width: calc(100% - 420px);
    }

    .mainbox_top_right_top {
      @include flex();
      justify-content: space-between;
      width: 100%;
      .title {
        font-size: 26px;
        font-family: Microsoft YaHei;
        font-weight: 700;
        color: #333;
        opacity: 1;
        margin-bottom: 14px;
      }
      .belong {
        font-size: 16px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #666;
        opacity: 1;
        margin-bottom: 16px;
        @include flex;
      }
      .twobtn {
        color: #fff;
        text-align: center;
        @include flex;

        .collect {
          background-color: rgb(254, 130, 9);
          width: 80px;
          height: 30px;
          line-height: 30px;
          font-size: 14px;
        }

        .liuyan {
          background-color: rgb(5, 96, 263);
          width: 80px;
          height: 30px;
          line-height: 30px;
          font-size: 14px;
        }
      }
    }

    .mainbox_top_right_content {
      p {
        font-size: 16px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #666;
        opacity: 1;
        margin-top: 14px;
      }
    }
  }

  .reasultdetail {
    margin-top: 37px;
    :deep(.el-tabs__item) {
      font-size: 28px;
      font-weight: 700;
      margin-bottom: 10px;
    }
    :deep(.el-tabs__content) {
      font-size: 16px;
      color: #2c3e50;
      line-height: 1.5;
    }
  }

  .aboutrequire {
    margin-top: 37px;
    .title {
      margin-left: 4px;
      font-size: 28px;
      font-family: Microsoft YaHei;
      font-weight: 700;
      line-height: 32px;
      color: #333;
      opacity: 1;
    }
    .aboutrequirebox {
      display: flex;
      justify-content: space-between;
      flex-wrap: wrap;
      .aboutrequirebox_item {
        &.xuqiu {
          width: 431px;
          height: 375px;
          background: #fff;
          box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
          opacity: 1;
          border-radius: 0;
          margin-bottom: 24px;
          .elimg {
            width: 431px;
            height: 233px;
          }
          .xq-box {
            padding: 24px;
            .title {
              width: 383px;
              font-size: 26px;
              font-family: Microsoft YaHei;
              font-weight: 700;
              color: #4a4a4a;
              opacity: 1;
              margin-bottom: 16px;
            }
            .grey {
              width: 100%;
              font-size: 14px;
              font-family: Microsoft YaHei;
              font-weight: 400;
              color: #c9c9c9;
              opacity: 1;
              white-space: nowrap;
              overflow: hidden;
              text-overflow: ellipsis;
              span {
                font-family: Microsoft YaHei;
                font-weight: 400;
                line-height: 26px;
                color: #8b8b8b;
                opacity: 1;
              }
            }
          }
        }
        .elimg {
          width: 290px;
          height: 130px;
        }

        .grey {
          color: #999;
          font-size: 14px;
        }
      }

      &.clc-ui {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        margin-left: 4px;
        margin-right: 4px;
      }

      &.clc-ui:after {
        content: "";
        width: 431px;
      }

      &.clc-ui li {
        padding: 16px;
        width: 431px;
        float: left;
        box-shadow: 0 3px 16px rgba(0, 0, 0, 0.08);
        box-sizing: border-box;
        min-height: 367px;
        margin-bottom: 10px;
        cursor: pointer;
        padding: 0;
      }

      .clc-lia {
        position: relative;
        height: 160px;
        overflow: hidden;
        margin-bottom: 25px;
      }

      .clcig {
        position: absolute;
        top: 8px;
        right: 1px;
        z-index: 9;
        width: 155px;
        height: 155px;
        background: #fff;
        border-radius: 50%;
      }

      .clc-lia img {
        z-index: 99;
        width: 150px;
        height: 150px;
        margin: 2px auto 0;
      }
      .clncol {
        color: #999;
        font-size: 16px;
      }
      .Adminis {
        display: block;
        color: #666;
        font-size: 16px;
      }
      .clc-lia-name {
        height: 110px;
        background: #f7f7f7;
        margin-top: 32px;
        text-align: left;
        padding: 30px 20px;
        box-sizing: border-box;
        position: relative;
      }

      .gang {
        width: 8px;
        height: 34px;
        position: absolute;
        top: 30px;
        left: -3px;
        background: #0561d2;
      }

      .clc-lia-name div b {
        display: block;
        font-size: 20px;
        width: 112px;
        height: 30px;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
      }
    }

    .contentitem {
      width: 100%;
      background-size: 100% 100%;
      display: flex;
    }

    img {
      width: 100px;
      height: 130px;
    }

    .contentitem_text {
      font-size: 16px;

      .level {
        color: #999;
      }
    }
  }
  .card_box {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    flex-wrap: wrap;

    .card {
      width: 443px;
      height: 392px;
      background: #fff;
      opacity: 1;
      border-radius: 0;
      margin-bottom: 50px;
      box-shadow: 0 3px 20px rgba(0, 0, 0, 0.1);
      img {
        width: 100%;
        height: 233px;
        vertical-align: bottom;
      }
      .card_text {
        height: 152px;
        text-align: left;
        margin: 23px 24px;
        .card_name {
          font-size: 19px;
          font-weight: 700;
          line-height: 27px;
          color: #0561d2;
        }
        .card_add,
        .card_name {
          width: 100%;
          text-align: left;
          font-family: Microsoft YaHei;
          opacity: 1;
          white-space: nowrap;
          text-overflow: ellipsis;
          overflow: hidden;
        }
        .card_add {
          font-size: 14px;
          font-weight: 400;
          line-height: 28px;
          color: #aaa;
          margin-top: 12px;
        }
        .card_pop_wrap {
          margin-top: 20px;
          .card_pop {
            background: hsla(0, 0%, 40%, 0.09);
            border-radius: 15px;
          }
          .card_pop,
          .pop {
            font-size: 14px;
            font-family: Microsoft YaHei;
            font-weight: 400;
            color: #666;
            opacity: 1;
            padding: 6px 10px;
            margin-top: 20px;
            margin-right: 8px;
          }
          .pop {
            background: #e0dfdf;
            border-radius: 50%;
          }
        }
      }
    }
  }
}
</style>
